<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue.js"></script>
	</head>
	<body>
		<h1 id="title"></h1>
		姓名:<input type="text" id="text"/>
		<script>
		var title=document.getElementById('title'),
		text=document.getElementById('text')
			text.oninput=function(){
				title.innerHTML=text.value
			}
			Object.defineProperty(text,'val',{
				get(){
					
					return this.value
				},
				set(str){
					
					this.value=str;
					title.innerHTML=str
				}
			})
		</script>
	</body>
</html>